Here is the definition of the root exception that was created for TOOL. All the predefined symbols are defined in InitialGlobalScope.scala. The compiler is thus aware of the existence of this class and of its methods.

The root exception is very basic : it only has one attribute, the error message and its associated getter and setter.

\begin{lstlisting}[language=Tool]
public class ToolException extends Throwable {
  protected String msg;
    
  public String getMessage() {
      return msg;
  }

  public ToolException setMessage(String msg) {
      this.msg = msg;
      return this;
  }
}
\end{lstlisting}

This should be enough in most cases, but if it were not, the programmer could easily add new attributes (see chapter \ref{Example}). The main problem is that TOOL's grammar doesn't allow the use of custom constructors, which means the programmer will need to define initializers methods for new attributes.

Note that \textsf{\small setMessage}'s return type is \textsf{\small ToolException}, this is way to ``simulate'' constructors, allowing the programmer to do this 
\begin{center}
\lstinline[language=Tool]{throw new ToolException.setMessage("bob")}.
\end{center}
